package com.bjsxt.common.util;

import java.util.Random;

import org.springframework.stereotype.Component;
@Component("regexUtil")
public class RegexUtil
{
	
	/**s
	 * 得到一个32位的随机字符串
	 */
	public static final String STR="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	public String getRandom(int length)
	{
		StringBuffer sb = new StringBuffer();
		Random random = new Random();
		for (int i = 0; i < length; i++)
		{
			int index = random.nextInt(this.STR.length());
			sb.append(this.STR.charAt(index));
		}
		return sb.toString();
	}
}
